package com.xieh.webmagic.magic;



import com.xieh.webmagic.magic.util.IdWorker;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import us.codecraft.webmagic.scheduler.RedisScheduler;

/**
 * @author 谢辉
 * @Classname MagicConfig
 * @Description TODO
 * @Date 2020/11/20 16:01
 */
@Configuration
public class MagicConfig {
    @Value("${spring.redis.host}")
    private String redis_host;

    @Bean
    public IdWorker idWorker(){
        return new IdWorker(1l,1l);
    }

    @Bean
    public RedisScheduler redisScheduler(){
        return new RedisScheduler(redis_host);
    }
}
